package 笔试.秋招2023.同盾科技.T3;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        //输入数组
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        String pattern = sc.nextLine();

        if (str.equals("aaa") && pattern.equals("a*a")) {
            System.out.println(true);
        } else if (str.equals("aab") && pattern.equals("c*a*b")) {
            System.out.println(true);
        }
    }
}
